import networkx as nx
import pandas as pd
import matplotlib.pyplot as plt

edges_df = pd.read_excel("edges_all.xlsx", engine="openpyxl")
G = nx.Graph()
points = []
for index, edge_row in edges_df.head(300).iterrows():
    u, v = edge_row['u'], edge_row['v']
    if u == v:
        print(u)
    else:
        if not G.has_node(u):
            G.add_node(u)
        if not G.has_node(v):
            G.add_node(v)
        G.add_edge(u, v)
nx.draw(G, with_labels=False, node_color='skyblue', node_size=15, edge_color='k')
plt.show()